package ssn.login.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import ssn.common.util.MD5Hash;
import ssn.login.service.LoginService;
import ssn.login.vo.LoginInfoVO;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
import egovframework.rte.fdl.string.EgovStringUtil;

/**  
 * @Class Name : 
 * @Description : 
 * 
 * @author ksh
 * @since 2013. 09.26
 * @version 1.0
 * @see
 */
@Service("loginService")
public class LoginServiceImpl extends AbstractServiceImpl implements LoginService {
	
	@Resource(name="loginDAO")
	private LoginDAO loginDAO; 
	
	/**
	 * 로그인 아이디 중복체크
	 */
	public boolean selectCheckLoginId(String chkId) throws Exception{
		if(EgovStringUtil.isNotEmpty(loginDAO.selectCheckLoginId(chkId)))
				return false;
		return true;
	}
	
	/**
	 * 로그인 처리
	 */
	public LoginInfoVO selectLoginInfo(LoginInfoVO vo) throws Exception{
		//MD5Hash encoder = new MD5Hash();
		//vo.setSsa_pass_word(encoder.getHash(vo.getSsa_pass_word()));
		
		vo = loginDAO.selectLoginInfo(vo);
		if(vo != null){
			vo.setLoginCheck(true);
		}
		return vo;
	}
}
